package com.ys.fmms.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "tb_permission")
@Schema(name = "菜单列表（按钮和菜单的权限）")
public class Permission {
    @TableId(type = IdType.ASSIGN_ID) // 指定主键生成策略使用雪花算法（默认策略）
    private String id;
    @Schema(description = "所属上级编号")
    private String pid;

    @Schema(description = "层级")
    @TableField(exist = false) // 用户表没有该字段 默认true
    private Integer level;

    @Schema(description = "下级")
    @TableField(exist = false)
    private List<Permission> children;

    @Schema(description = "角色是否有其菜单访问权限 false:没有 true:有")
    @TableField(exist = false)
    private boolean select;

    private String name;
    @Schema(description = "1:菜单 2:按钮")
    private String type;
    @Schema(description = "权限值 哪个表中的按钮的权限")
    private String permissionValue;
    private String path;
    private String component;
    private String icon;
    @Schema(description = "0:禁止 1:正常")
    private Integer status;
    @Schema(description = "0:未删除 1:删除")
    private Integer isDeleted;
    private Date createTime;
    private Date modifyTime;
}
